<?php
/*
* Event System Userguide
* 
* https://github.com/opencart/opencart/wiki/Events-(script-notifications)-2.2.x.x
*/
class Event {
    protected $registry;
    protected $data = array();

    public function __construct($registry) {
        $this->registry = $registry;
    }
  

    public function exec(){
       
        $arr = array(); 
        if($this->registry->data){
            //在 event对象中，执行其他对象
            foreach($this->registry->data as $key =>$val){
                //执行对象中的方法
                $arr[] = $val->dump();
            }
        }
           
        return $arr;
    }


    public function dump(){
        return 'Event';
    }
}